<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">
            <title>Cindy JS</title>
            <script type="text/javascript" src="../build/js/Cindy.js"></script>
            <link rel="stylesheet" href="../css/cindy.css">


            </head>

	<body style="font-family:Arial;">

        <h1>CindyJS: Image Spiral</h1>

				<script id='csinit' type='text/x-cindyscript'>
						interpolate = true;
				</script>
        <script id='csmove' type='text/x-cindyscript'>
            a=0;
            s=1;
            pos=complex(A);
            pos2=complex(B);
            mul=complex(C)*.1;
            al=1;
            li=apply(0..400,

                   s=|pos|*.2;
                   a=-arctan2(gauss(pos));
                   erg=(gauss(pos),gauss(pos2),a,s,al);
                     pos=pos*mul;
                     pos2=pos2*mul;
                     al=al*0.98;
                   erg;
            );
            forall(reverse(li),
                   drawimage(#_1,#_2,"rost",angle->#_3,scale->#_4,alpha->#_5, interpolate->interpolate);

                   );
            draw(A);
            draw(B);
            draw(C,color->(1,0,0));
        </script>

        <div  id="CSCanvas" style="width:500px; height:500px; border:2px solid #000000"></div>
				<script type="text/javascript">
						var gslp=[
											{name:"A", kind:"P", type:"Free", pos:[4,0,1],size:3,color:[1,.7,0]},
											{name:"B", kind:"P", type:"Free", pos:[8,0,1],size:3,color:[1,.7,0]},
											{name:"C", kind:"P", type:"Free", pos:[8,3,1],size:4}
											];
						var cdy = CindyJS({canvasname:"CSCanvas",
												scripts: "cs*",
												geometry:gslp,
												images:{rost:"rost.png",boe:"boe.png"}
												});
					</script>
					<input onclick="cdy.evokeCS('interpolate =' + this.checked)" checked type="checkbox" >interpolate linear

	</body>
</html>
